package com.hzlj.position.locate.controller;


import com.fz.common.base.dto.PageParamDTO;
import com.fz.common.base.dto.QueryPageResultDTO;
import com.fz.common.base.dto.ResultDTO;
import com.hzlj.position.locate.common.dto.abnMissingJzryNotice.AbnMissingJzryNoticeQueryParamDTO;
import com.hzlj.position.locate.common.dto.abnMissingJzryNotice.AbnMissingJzryNoticeQueryResultDTO;
import com.hzlj.position.locate.common.enums.AbnMissingStep;
import com.hzlj.position.locate.service.AbnMissingJzryNoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
/**
 * 【定位分析-疑似失联人员-通知】接口
 *
 * @author makejava
 * @date 2024-06-25 14:40:36
 */
@Slf4j
@RestController
@RequestMapping("/position/abn/missing/jzry/notice")
public class AbnMissingJzryNoticeController {
    
    @Resource
    private AbnMissingJzryNoticeService abnMissingJzryNoticeService;
    
    /**
    * 通过id查询定位分析-疑似失联人员-通知
    */
    @GetMapping("/{id}")
    public ResultDTO<AbnMissingJzryNoticeQueryResultDTO> getAbnMissingJzryNoticeById(@PathVariable("id") String id) {
        log.debug("【查询信息】定位分析-疑似失联人员-通知:id={}", id);
        return new ResultDTO<>(abnMissingJzryNoticeService.getAbnMissingJzryNoticeById(id));
    }

    /**
     * 手动发送通知
     */
    @GetMapping("/step/{step}")
    public ResultDTO<?> notice(@PathVariable("step") String step) {
        abnMissingJzryNoticeService.notice(AbnMissingStep.of(step));
        return new ResultDTO<>();
    }

    /**
     * 列表查询 定位分析-疑似失联人员-通知
     */
    @GetMapping("/list")
    public ResultDTO<List<AbnMissingJzryNoticeQueryResultDTO>> listAbnMissingJzryNotice(AbnMissingJzryNoticeQueryParamDTO dto){
        log.debug("【查询无分页列表】信息定位分析-疑似失联人员-通知,AbnMissingJzryNoticeQueryParamDTO={}",dto);
        return new ResultDTO<>(abnMissingJzryNoticeService.listAbnMissingJzryNotice(dto));
    }
   
    /**
     * 分页查询 定位分析-疑似失联人员-通知
     */
     @GetMapping("/list/page")
    public ResultDTO<QueryPageResultDTO<AbnMissingJzryNoticeQueryResultDTO>>  pageAbnMissingJzryNotice(AbnMissingJzryNoticeQueryParamDTO dto,PageParamDTO pageParamDTO){
        log.debug("【查询分页列表】信息定位分析-疑似失联人员-通知,AbnMissingJzryNoticeQueryParamDTO={},pageParamDTO={}",dto,pageParamDTO);
        return new ResultDTO<>(abnMissingJzryNoticeService.pageAbnMissingJzryNotice(dto,pageParamDTO));
    }

}

